
hui.loading('加载中');
setTimeout(function () {
    hui.loading(false,true);
},1000);
if (islogin()) {
    $.ajax({
        url:'../requests/select_classes.php',
        type:'POST',
        success:function (data) {
            if (data.length < 1) {
                hui.iconToast("您还没有创建班级，点击底部'+'创建班级",'warn');
            }
            else for (var i=0;i<data.length;i++){
                var dom="<li>\n" +
                    "                <div class=\"hui-list-text\">\n" +
                    "                    <div class=\"hui-list-text-content\">\n" +
                    "                        <span class='class_num'>"+data[i].num+"</span><span>"+data[i].name+"</span>\n" +
                    "                    </div>\n" +
                    "                    <div class=\"hui-list-info\">\n" +
                    "                        <span>班级人数:<span>"+data[i].sum+"</span></span>\n" +
                    "                        <span>&nbsp;查看</span>\n" +
                    "                        <span class=\"hui-icons hui-icons-right\"></span>\n" +
                    "                    </div>\n" +
                    "                </div>\n" +
                    "            </li>";
                $('.hui-wrap ul').append(dom);
            }
        }
    });
    $('.hui-list').on('click','.hui-list-info',function () {
        var class_num=$(this).prev().children('.class_num').html();
        window.location.href="details_stu.html?"+class_num;
    });
}
else {
    window.location.href='../index.html';
}
